package chapter;

public class object_bean {
    public static void main(String[] args) {
        //TODO Bean类设计规范：Bean规范
        //类要求必须含有无参，公共的构造方法
        //属性必须私有化，然后提供公共的set,get方法                                                                                                                                                                                                                                             
    User user = new User();
    user.SetAccount("admin");
    user.SetAccount("admin");
        System.out.println(login(user));
    }
    public static boolean login(User user) {
        //将user传过来
        if (user.GetAccount().equals("admin") && user.GetAccount().equals("admin")) {
            return true;
        }else
            return false;

    }
}
class User {
    private  String account;
    private String password;
    public void SetAccount(String account) {
        this.account = account;
    }
    public void SetPassword(String password) {
        this.password = password;
    }
    public String GetAccount() {
        return account;
    }
    public String GetPassword() {
        return password;
    }
}